-
Notifications
You must be signed in to change notification settings - Fork 405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: use field initializers for injectees #2258
Conversation
In this commit, we remove constructor parameters to ensure compatibility with the `useDefineForClassFields` compiler option. When public class fields are enabled, such cases throw a `TS2729: Property used before its initialization` error. This occurs when a property (e.g., an injectee) is referenced before the constructor is executed. Additionally, we are removing property decorators such as `@Inject` with this change. Property decorators are not permitted when experimental decorators are disabled. This adjustment helps make the framework compatible with these TypeScript compiler options moving forward.
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 67204a8. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 4 targetsSent with 💌 from NxCloud. |
commit: |
BundleMonUnchanged files (6)
No change in files bundle size Unchanged groups (2)
Final result: ✅ View report in BundleMon website ➡️ |
BundleMon (NGXS Plugins)Unchanged files (9)
No change in files bundle size Unchanged groups (1)
Final result: ✅ View report in BundleMon website ➡️ |
BundleMon (Integration Projects)Unchanged files (3)
No change in files bundle size Final result: ✅ View report in BundleMon website ➡️ |
Code Climate has analyzed commit fac2e57 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 95.3% (0.0% change). View more on Code Climate. |
In this commit, we remove constructor parameters to ensure compatibility with the
useDefineForClassFields
compiler option. When public class fields are enabled, such cases throw aTS2729: Property used before its initialization
error. This occurs when a property (e.g., an injectee) is referenced before the constructor is executed.Additionally, we are removing property decorators such as
@Inject
with this change. Property decorators are not permitted when experimental decorators are disabled. This adjustment helps make the framework compatible with these TypeScript compiler options moving forward.